//package cn.edu.hqu.javaee.Entity;
////import java.util.Arrays;
////import java.util.Collection;
////import javax.persistence.Entity;
////import javax.persistence.GeneratedValue;
////import javax.persistence.GenerationType;
////import javax.persistence.Id;
////import org.springframework.security.core.GrantedAuthority;
////import org.springframework.security.core.authority.
////                                          SimpleGrantedAuthority;
////import org.springframework.security.core.userdetails.UserDetails;
////import lombok.AccessLevel;
////import lombok.Data;
////import lombok.NoArgsConstructor;
////import lombok.RequiredArgsConstructor;
////
////@Entity
////@Data
////@NoArgsConstructor(access=AccessLevel.PRIVATE, force=true)
////@RequiredArgsConstructor
////public class User implements UserDetails {
////
////  private static final long serialVersionUID = 1L;
////
////  @Id
////  @GeneratedValue(strategy=GenerationType.AUTO)
////  private Long id;
////  
////  private final String username;
////  private final String password;
////
////  
////  @Override
////  public Collection<? extends GrantedAuthority> getAuthorities() {
////    return Arrays.asList(new SimpleGrantedAuthority("ROLE_USER"));
////  }
////
////  @Override
////  public boolean isAccountNonExpired() {
////    return true;
////  }
////
////  @Override
////  public boolean isAccountNonLocked() {
////    return true;
////  }
////
////  @Override
////  public boolean isCredentialsNonExpired() {
////    return true;
////  }
////
////  @Override
////  public boolean isEnabled() {
////    return true;
////  }
////
////}
//
//
//
//
//import lombok.Data;
//import lombok.Getter;
//
//import lombok.Setter;
//
//import javax.persistence.Entity;
//import javax.persistence.Id;
//import javax.persistence.Table;
//
//
//
//
//@Data
//@Entity
//@Table(name="user")
//public class User {
//	@Getter
//	@Setter
//    @Id
//    private String username;
//	@Getter
//	@Setter
//    private String password;
//	
//	
//
//	
//}
package cn.edu.hqu.javaee.Entity;
import java.util.Arrays;
import java.util.Collection;
import javax.persistence.Entity;

import javax.persistence.Id;
import javax.persistence.Table;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.
                                          SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
@Table(name="user")
@Entity
@Data

public class User implements UserDetails {

  

  @Id

  
  @Getter
  @Setter
  private String username;
  @Getter
  @Setter
  private String password;
 
  
  @Override
  public Collection<? extends GrantedAuthority> getAuthorities() {
    return Arrays.asList(new SimpleGrantedAuthority("ROLE_USER"));
  }

  @Override
  public boolean isAccountNonExpired() {
    return true;
  }

  @Override
  public boolean isAccountNonLocked() {
    return true;
  }

  @Override
  public boolean isCredentialsNonExpired() {
    return true;
  }

  @Override
  public boolean isEnabled() {
    return true;
  }

}